\documentclass[main.tex]{subfiles}

\begin{document}
Hello world.
\end{document}

